﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Perovich.GameObjects.Components
{
    public interface IEntityComponent : IUpdateable, IDisposable
    {
        /// <summary>
        /// Initialize is called when the component has been attached to an entity.
        /// </summary>
        void OnAttached(bool addDependencies);
        /// <summary>
        /// Start is called just before the first time the Update method is called.
        /// </summary>
        void Initialize();
        /// <summary>
        /// Gets the owner of this component.
        /// </summary>
        IEntity Owner { get; }

        event EventHandler<EntityEventArgs> OwnerChanged;
    }

    public class EntityEventArgs : EventArgs
    {
        IEntity entity;

        public EntityEventArgs(IEntity entity)
        {
            this.entity = entity;
        }

        public IEntity Entity
        {
            get
            {
                return entity;
            }
        }
    }
}
